﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace SmoLiteApi
{
    /// <summary/>
    public class FullTextIndexColumnCollection : IEnumerable<FullTextIndexColumn>
    {
        private List<FullTextIndexColumn> _fullTextIndexColumns;

        /// <summary/>
        internal FullTextIndexColumnCollection()
        {
            this._fullTextIndexColumns = new List<FullTextIndexColumn>();
        }

        /// <summary/>
        public void Add(FullTextIndexColumn fullTextIndexColumn)
        {
            this._fullTextIndexColumns.Add(fullTextIndexColumn);
        }

        /// <summary/>
        public FullTextIndexColumn this[string name]
        {
            get { return this._fullTextIndexColumns.Find(value => value.Name == name); }
        }

        /// <summary/>
        public IEnumerator<FullTextIndexColumn> GetEnumerator()
        {
            return this._fullTextIndexColumns.GetEnumerator();
        }

        /// <summary/>
        IEnumerator IEnumerable.GetEnumerator()
        {
            return this._fullTextIndexColumns.GetEnumerator();
        }
    }
}
